<template>
	<div class="goTop" @click="gotop">
		<i class="icons"><svg viewBox="0 0 20.413 12.425" width="1em" height="1em" fill="currentColor"
				aria-hidden="true" focusable="false">
				<use xlink:href="/icons/icon.svg#comm_icon_fhdb--sprite"></use>
			</svg></i>
		<span>{{$t('h_goTop.title')}}</span>
	</div>
</template>

<script>
	export default {
		data() {
			return {

			};
		},
		methods: {
			gotop() {
				document.querySelectorAll('.scroll-containers')[0].scrollTop = 0
			}
		}
	}
</script>

<style lang="less">
	.goTop {
		width: 1.2rem;
		height: 1.2rem;
		position: fixed;
		bottom:1.3rem;
		right: 0.2rem;
		display: flex;
		flex-direction: column;
		align-items: center;
		background-color: var(--theme-main-bg-color);
		border: 0.01rem solid var(--theme-color-line);
		border-radius: 0.1rem;
		-webkit-box-shadow: 0.02rem 0 0.06rem 0 rgba(0,0,0,.1);
		box-shadow: 0.02rem 0 0.06rem 0 rgba(0,0,0,.1);
		z-index: 110;
		i {
			display: flex;
			align-items: center;
			display: block;
			width: .6rem;
			height: .6rem;
			line-height: .8rem;
			font-size: .6rem;
			text-align: center;
			background-color: var(--theme-primary-color);
			border-radius: 50%;
			color: var(--theme-primary-font-color);
			margin: .16rem auto 0;
		}
		span{
			word-wrap: break-word;
			color: var(--theme-text-color-lighten);
			font-size: .18rem;
			display: block;
			text-align: center;
		}
	}
</style>